package mapper;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import pojo.Product;

import java.util.List;

public interface ProductMapper {

    @Select("select * from product where product_typeid = #{id}")
    @Results(id = "productMap", value = {
            @Result(id = true, column = "product_id" , property = "id"),
            @Result(column = "product_name", property = "name"),
            @Result(column = "product_price", property = "price")
    })
    public List<Product> findProductById(int id);

}
